<!-- 我的客户 -->
<template>
	<view class="content">
		<view class="team">
			<ul>
				<li v-for="item in khLists" :key="item.id">
					<view class="left">
						<image :src="item.images"></image>
						<view class="name_tal">
							<view class="name">{{item.nickname}}</view>
							<!-- <view class="tal">手机：{{item.mobile}}</view> -->
						</view>
					</view>
					<!-- <view class="right">
						<view class="key">加入时间</view>
						<view class="time">{{item.bdtime}}</view>
					</view> -->
				</li>
				<!-- <li>
					<view class="left">
						<image src="/static/logo.jpg"></image>
						<view class="name_tal">
							<view class="name">张三</view>
							<view class="tal">18630452736</view>
						</view>
					</view>
					<view class="right">
						<view class="key">加入时间</view>
						<view class="time">2023-04-06</view>
					</view>
				</li> -->
			</ul>
		</view>
		<view class="but" @click="commission">
			<text>我的客户佣金</text>
		</view>
	</view>
</template>

<script>
	const app = getApp();
	const request = require('../../utils/request');
	export default {
		data() {
			return {
				code: '',
				page:1,
				khLists:[]
			}
		},
		onLoad() {
			this.kh_lists();
		},
		methods: {
			commission(){
				uni.navigateTo({
					url:'/pages/my/commission?type=1'
				})
			},
			
			kh_lists:function(){
				var that = this;
				//网络请求
				request(app.globalData.api_url+'/v1/user/kh_lists', 'POST', {
					page:that.page
				}).then((res) => {
					if(res.data.code == 0){
						console.log(res);
						that.khLists = that.khLists.concat(res.data.data);
					}else{
						uni.showToast({
							title:res.data.msg,
							icon:'none'
						});
						app.is_login_check(res.data);
					}
				});
			},
		},
		onReachBottom() {
			this.page++;
			this.kh_lists();
		}
	}
</script>

<style scoped lang="scss">
	page{
		background-color: #f7f7f7;
		padding-top: 30rpx;
	}
	.content{
		position: relative;
		.team{
			background-color: #fff;
			padding: 0 30rpx 160rpx;
			border-radius: 10rpx;
			ul{
				margin: 0;
				padding: 0;
				li{
					display: flex;
					align-items: center;
					justify-content: space-between;
					padding: 30rpx 0;
					border-bottom: 2rpx solid #f7f7f7;
					.left{
						display: flex;
						align-items: center;
						image{
							width: 90rpx;
							height: 90rpx;
							border-radius: 50%;
							margin-right: 30rpx;
						}
						.name_tal{
							.name{
								font-size: 28rpx;
								line-height: 28rpx;
								color: #000;
							}
							.tal{
								margin-top: 14rpx;
								font-size: 24rpx;
								line-height: 24rpx;
								color: #333;
							}
						}
					}
					.right{
						.key,.time{
							font-size: 24rpx;
							line-height: 24rpx;
							color: #999;
							margin-bottom: 10rpx;
							text-align: right;
						}
						.time{
							margin-bottom: 0;
						}
					}
				}
			}
		}
		.but{
			background-color: #38c763;
			width: 90%;
			height: 100rpx;
			border-radius: 50rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			position: fixed;
			bottom: 40rpx;
			left: 50%;
			transform: translate(-50%,0);
			text{
				color: #fff;
				font-size: 30rpx;
				line-height: 30rpx;
				letter-spacing: 2rpx;
			}
		}
	}
	
</style>